import java.util.Scanner;

public class demo01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        int count1=0;
        int count2=0;
        for(int i=0;i<n;i++){
            int grade=sc.nextInt();
            if(grade>=60){
                count1++;
                if(grade>=85){
                    count2++;
                }
            }
        }
        double jige=count1*1.0/n*100;
        if(jige%1>0.5){
            jige++;
        }
        double youxiu=count2*1.0/n*100;
        if(youxiu%1>0.5){
            youxiu++;
        }
        System.out.println((int)jige+"%");
        System.out.println((int)youxiu+"%");
        sc.close();
    }
}
